<template>
	<view class="">
			<view class="none" v-if="show">
				<view class="coent">
					<u-empty text="暂无报告" mode="list" icon-size="200">
					</u-empty>
				</view>
			</view>
			<view class="conentaa" v-else>
				<view class="jiancha" v-for="(item,index) in datalist" :key="index">
					<view class="titlejc">
						<span>{{item.xmmc}}</span>
					</view>
					<!-- //特检报告 -->
					<view class="rowsjc"  v-if="item.xmbm=='tejian'" v-for="(rows,indexrows) in item.rows" :key="indexrows" @click="tejian(rows.data)"> 
						<view class="">
							<span>{{rows.eqname}}</span>
						</view>
						<view class="">
							<span>{{rows.time}}</span>
						</view>
					</view>
					<!-- 验光项目 -->
					<view class="sl" v-if="item.xmbm=='yanguang'" v-for="(ygrows,ygrowsrows) in item.rows" :key="ygrowsrows" @click="yanguang(ygrows.data)">
						<view class="rowsjc borbotm">
							<span>{{ygrows.eqname}}</span>
							<span>{{ygrows.time}}</span>
						</view>
					</view>
				</view>
			</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				show:true,
				jianyival:'',
				screenHeight: getApp().globalData.screenHeight-44,
				datalist: '',
				}
		},
		onLoad() {
			this.list()
		},
		methods: {
			yanguang(e){
				let data=JSON.stringify(e)
				uni.navigateTo({
					url: `/pages/zhuyaun/bgcx/slbg?data=${data}`,
				})
			},
			tejian(e){
				uni.navigateTo({
					url: `/pages/zhuyaun/bgcx/bgcx?e=${e}`,
				})
			},
			list() {
				uni.showLoading({
					title: '请稍后',
					mask: true
				});
				this.$request("xzfx","pacslist").then(res => {
					console.log("检查查询", res)
					if (res.code == 1) {
						this.datalist = res.data.resultdata
						if(this.datalist.length==0){
							this.show=true
						}else{
							this.show=false
						}
						console.log("show",this.show)
						uni.hideLoading();
					} else {
						this.show=true
						uni.hideLoading();
						uni.showToast({
							title: res.msg,
							icon: 'none',
							duration: 2000
						});
					}
				}).catch(err => {
					uni.hideLoading();
					console.log("err", err)
					uni.showToast({
						title: err,
						icon: 'none',
						duration: 1000
					});
				});
			}
		}
	}
</script>

<style>
	@import './bgcx.css';
</style>